package indi.zhifa.expshare.class001.chemicalmatch.entity.po;

import indi.zhifa.expshare.class001.chemicalmatch.enums.EConstEnum;
import indi.zhifa.expshare.class001.chemicalmatch.enums.EModuleType;
import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.List;

@Data
@Document(collection = "nick_name")
public class NickNameMongoData {
    String id;
    /**
     * chemical  化学品
     * product  产品
     */
    EModuleType module;
    /**
     * 产品下，这个字段是产品名
     */
    String subModule;

    /**
     * 昵称
     */
    List<String> nickNames = new ArrayList<>();

    String name;

    public void initByChemical() {
        this.module = EModuleType.CHEMICAL;
        this.subModule = EConstEnum.SUBMODULE_NONE.getCode();
    }

    public void addNickName(String pNickName){
        nickNames.add(pNickName);
    }
}
